community! I have looked up many resources including cypress.io, but didn't find such info. So, I'm guessing cypress doesn't support this opportunity but maybe someone has some clues.
Is Cypress able to use the test block "it" within "support" folder with Custom Commands or can I only use it within "integration" folder?
I have a lot of API requests where, for example, the response 200 is similar to each other. It would be fine to reuse these expects like reusable functions in Custom Commands
The next expects I would want to reuse for the different spec.js. Is it possible?
it('Response has status 200', () => {
expect(responseBody.status).to.eq(200)
})
it('Field "success" has value "true"', () => {
expect(responseBody.body.status.success).to.eq(true)
})
it('Field "code" has response "200"', () => {
expect(responseBody.body.status.code).to.eq(200)
})
it('Field "message" has value "OK"', () => {
expect(responseBody.body.status.message).to.eq("OK")
})
it('Check the length of the list', () => {
expect(responseBody.body.result.length).to.be.eq(237)
})
it('Check the USA is present in the list', () => {
expect(responseBody.body.result[224].name).to.eq("United States")
})